package com.hfzy.ihk.facade.linkcall.entity.knowledge;

import com.alibaba.fastjson.annotation.JSONField;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.hfzy.ihk.common.facade.BaseEntity;
import com.hfzy.ihk.facade.linkcall.enums.QuestionSourceType;
import com.hfzy.ihk.facade.linkcall.enums.QuestionStatus;
import org.springframework.data.annotation.Id;
import org.springframework.data.elasticsearch.annotations.DateFormat;
import org.springframework.data.elasticsearch.annotations.Document;
import org.springframework.data.elasticsearch.annotations.Field;
import org.springframework.data.elasticsearch.annotations.FieldType;

import java.util.Date;

/**
 * Created by Administrator on 2018/7/19.
 * 问题库
 *
 * 无法识别的问题
 * @author wws
 */
@Document(indexName = "#{elasticSearchConfig.indexName()}_question_base",shards = 24,replicas = 2, type = "data")
public class QuestionBase implements BaseEntity {

    @Id
    private String id;

    private long version;

    /**
     * 问题内容
     * */
    @Field(type = FieldType.Keyword)
    private String question;

    @Field(type = FieldType.Keyword)
    private QuestionStatus status;

    /**来源通话记录*/
    @Field(type = FieldType.Keyword)
    private String sourceCallHistoryId;


    /**来源主流程哪个步骤*/
    @Field(type = FieldType.Keyword)
    private String sourceFlowStepId;

    /**
     * 来源类型.枚举
     *  CALL_RECORDS("callRecords","通话记录"),

        APP_TRAINING("appTraining","小程序训练"),

     */
    @Field(type = FieldType.Keyword)
    private QuestionSourceType questionSourceType;

    @Field(type = FieldType.Date, format = DateFormat.custom, pattern = "yyyy-MM-dd HH:mm:ss" )
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss",timezone = "GMT+8")
    @JSONField(format="yyyy-MM-dd HH:mm:ss")
    private Date createTime;

    private long modUserId;

    @Field(type = FieldType.Date, format = DateFormat.custom, pattern = "yyyy-MM-dd HH:mm:ss" )
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss",timezone = "GMT+8")
    @JSONField(format="yyyy-MM-dd HH:mm:ss")
    private Date modTime;

    /**
     * 话术包id
     * 目前知识库和话术包关联
     * */
    @Field(type = FieldType.Keyword)
    private String packageId;

    @Override
    public String getId() {
        return id;
    }

    public void setId(String id) {
        this.id = id;
    }

    public long getVersion() {
        return version;
    }

    public void setVersion(long version) {
        this.version = version;
    }

    public String getQuestion() {
        return question;
    }

    public void setQuestion(String question) {
        this.question = question;
    }

    public QuestionStatus getStatus() {
        return status;
    }

    public void setStatus(QuestionStatus status) {
        this.status = status;
    }

    public String getSourceCallHistoryId() {
        return sourceCallHistoryId;
    }

    public void setSourceCallHistoryId(String sourceCallHistoryId) {
        this.sourceCallHistoryId = sourceCallHistoryId;
    }

    public Date getCreateTime() {
        return createTime;
    }

    public void setCreateTime(Date createTime) {
        this.createTime = createTime;
    }

    public long getModUserId() {
        return modUserId;
    }

    public void setModUserId(long modUserId) {
        this.modUserId = modUserId;
    }

    public Date getModTime() {
        return modTime;
    }

    public void setModTime(Date modTime) {
        this.modTime = modTime;
    }

    public String getSourceFlowStepId() {
        return sourceFlowStepId;
    }

    public void setSourceFlowStepId(String sourceFlowStepId) {
        this.sourceFlowStepId = sourceFlowStepId;
    }

    public String getPackageId() {
        return packageId;
    }

    public void setPackageId(String packageId) {
        this.packageId = packageId;
    }

    public QuestionSourceType getQuestionSourceType() {
        return questionSourceType;
    }

    public void setQuestionSourceType(QuestionSourceType questionSourceType) {
        this.questionSourceType = questionSourceType;
    }
}
